package StudyCode.summary.myfile;

import java.io.FileDescriptor;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class ForceUpdateFile {
	public static void main(String[] argv) {
		try {
			FileOutputStream os = new FileOutputStream("E:\\Copy\\test.txt");
			FileDescriptor fd = os.getFD();
			byte[] data = new byte[]{(byte) 0xCA, (byte) 0xFE, (byte) 0xBA, (byte) 0xBE};
			os.write(data);
			os.flush();
			fd.sync();
			System.out.println("写入成功。");
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
